﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ILN.MVC.Datetimepicker
{
    public class DatetimepickerOptions
    {
        /// <summary>
        /// See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker
        /// Default: null
        /// </summary>
        public string format { get; set; }
        /// <summary>
        /// Changes the heading of the datepicker when in "days" view.
        /// Default: 'MMMM YYYY'
        /// </summary>
        public string dayViewHeaderFormat { get; set; }
        /// <summary>
        /// Allows for several input formats to be valid. See this PR.
        /// Default: null
        /// </summary>
        public string extraFormats { get; set; }
        /// <summary>
        /// Change the default icons for the pickers functions.
        /// Accepts: object with all or some of the parameters above
        /// {
        ///     time: 'glyphicon glyphicon-time',
        ///     date: 'glyphicon glyphicon-calendar',
        ///     up: 'glyphicon glyphicon-chevron-up',
        ///     down: 'glyphicon glyphicon-chevron-down',
        ///     previous: 'glyphicon glyphicon-chevron-left',
        ///     next: 'glyphicon glyphicon-chevron-right',
        ///     today: 'glyphicon glyphicon-screenshot',
        ///     clear: 'glyphicon glyphicon-trash',
        ///     close: 'glyphicon glyphicon-remove'
        /// }
        /// </summary>
        public string icons { get; set; }
        /// <summary>
        /// Number of minutes the up/down arrow's will move the minutes value in the time picker
        /// Default: 1
        /// </summary>
        public int stepping { get; set; }
        /// <summary>
        /// Prevents date/time selections before this date
        /// Default: null
        /// </summary>
        public DateTime? minDate { get; set; }
        /// <summary>
        /// Prevents date/time selections after this date
        /// Default: null
        /// </summary>
        public DateTime? maxDate { get; set; }
        /// <summary>
        /// On show, will set the picker to the current date/time
        /// </summary>
        public bool? useCurrent { get; set; }
        /// <summary>
        /// Using a Bootstraps collapse to switch between date/time pickers.
        /// Default: true
        /// </summary>
        public bool? collapse { get; set; }
        /// <summary>
        /// See momentjs for valid locales.
        /// You must include moment-with-locales.js or a local js file.
        /// Default: en-US
        /// </summary>
        public string locale { get; set; }
        /// <summary>
        /// Sets the picker default date/time. Overrides useCurrent
        /// Default: null
        /// </summary>
        public string defaultDate { get; set; }
        /// <summary>
        /// Disables selection of dates NOT in the array, e.g. holidays
        /// Default: null
        /// </summary>
        public string enabledDates { get; set; }
        /// <summary>
        /// Defines if moment should use strict date parsing when considering a date to be valid
        /// </summary>
        public bool? useStrict { get; set; }
        /// <summary>
        /// Shows the picker side by side when using the time and date together.
        /// </summary>
        public bool? sideBySide { get; set; }
        /// <summary>
        /// Disables the section of days of the week, e.g. weekends.
        /// Default: []
        /// </summary>
        public string daysOfWeekDisabled { get; set; }
        /// <summary>
        /// Shows the week of the year to the left of first day of the week.
        /// Default: false
        /// </summary>
        public bool? calendarWeeks { get; set; }
        /// <summary>
        /// The default view to display when the picker is shown.
        /// Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY
        /// Default: ViewModeOptions.DAYES
        /// Accepts: ViewModeOptions.YEARS,ViewModeOptions.MONTHS,ViewModeOptions.DAYES
        /// </summary>
        public string viewMode { get; set; }
        /// <summary>
        /// Changes the placement of the icon toolbar.
        /// Default: ToolbarPlacementOption.DEFAULT
        /// Accepts: ToolbarPlacementOption.DEFAULT, ToolbarPlacementOption.TOP, ToolbarPlacementOption.BOTTOM
        /// </summary>
        public string toolbarPlacement { get; set; }
        /// <summary>
        /// Show the "Today" button in the icon toolbar.
        /// Clicking the "Today" button will set the calendar view and set the date to now.
        /// Default: false
        /// </summary>
        public bool? showTodayButton { get; set; }
        /// <summary>
        /// Show the "Clear" button in the icon toolbar.
        /// Clicking the "Clear" button will set the calendar to null.
        /// Default: false
        /// </summary>
        public bool? showClear { get; set; }
        /// <summary>
        /// Show the "Close" button in the icon toolbar.
        /// Clicking the "Close" button will call hide()
        /// Default: false
        /// </summary>
        public bool? showClose { get; set; }
        /// <summary>
        /// Accepts: object with the all or one of the parameters above
        /// horizontal: 'auto', 'left', 'right'
        /// vertical: 'auto', 'top', 'bottom'
        /// </summary>
        public string widgetPositioning { get; set; }
        /// <summary>
        /// Will cause the date picker to stay open after selecting a date if no time components are being used.
        /// Default: false
        /// </summary>
        public bool? keepOpen { get; set; }
        /// <summary>
        /// Will display the picker inline without the need of a input field. This will also hide borders and shadows.
        /// Default: false
        /// </summary>
        public bool? inline { get; set; }
        /// <summary>
        /// Will cause the date picker to not revert or overwrite invalid dates.
        /// Default: false
        /// </summary>
        public bool? keepInvalid { get; set; }
        /// <summary>
        /// Allows for custom events to fire on keyboard press.
        /// </summary>
        public string keyBinds { get; set; }
        /// <summary>
        /// Will cause the date picker to stay open after a blur event.
        /// Default: false
        /// </summary>
        public bool? debug { get; set; }
        /// <summary>
        /// Disables time selection between the given moments
        /// </summary>
        public string disabledTimeIntervals { get; set; }
        /// <summary>
        /// If true, the picker will show on textbox focus and icon click when used in a button group
        /// Default: false
        /// </summary>
        public bool? allowInputToggle { get; set; }
        /// <summary>
        /// If false, the textbox will not be given focus when the picker is shown
        /// Default: true
        /// </summary>
        public bool? focusOnShow { get; set; }
        /// <summary>
        /// Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days
        /// </summary>
        public string enabledHours { get; set; }
        /// <summary>
        /// Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days
        /// </summary>
        public string disabledHours { get; set; }
        /// <summary>
        /// This will change the viewDate without changing or setting the selected date.
        /// </summary>
        public bool? viewDate { get; set; }
        /// <summary>
        /// This will change the tooltips over each icon to a custom string
        /// </summary>
        public string tooltips { get; set; }
    }
  
    public class ViewModeOptions
    {
        public const string DAYS = "days";
        public const string YEARS = "years";
        public const string MONTHS = "months";
    }

    public class ToolbarPlacementOption
    {
        public const string DEFAULT = "default";
        public const string TOP = "top";
        public const string BOTTOM = "bottom";
    }

    public class IconOptions
    {
        public string time { get; set; }
        public string date { get; set; }
        public string up { get; set; }
        public string down { get; set; }
        public string previous { get; set; }
        public string next { get; set; }
        public string today { get; set; }
        public string clear { get; set; }
    }
}